import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const queryGeneralBizDict = (params) => {
  params.head.transCode = 'queryGeneralBizDict';
  return request({
    url: '/general/generalBizDict/queryGeneralBizDict',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const queryGeneralBizDictListPage = (params) => {
  params.head.transCode = 'queryGeneralBizDictListPage';
  return request({
    url: '/general/generalBizDict/queryGeneralBizDictListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveGeneralBizDict = (params) => {
  params.head.transCode = 'saveGeneralBizDict';
  return request({
    url: '/general/generalBizDict/saveGeneralBizDict',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveGeneralBizDictList = (params) => {
  params.head.transCode = 'saveGeneralBizDictList';
  return request({
    url: '/general/generalBizDict/saveGeneralBizDictList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateGeneralBizDict = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralBizDict';
  return request({
    url: '/general/generalBizDict/saveOrUpdateGeneralBizDict',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateGeneralBizDictList = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralBizDictList';
  return request({
    url: '/general/generalBizDict/saveOrUpdateGeneralBizDictList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateGeneralBizDict = (params) => {
  params.head.transCode = 'updateGeneralBizDict';
  return request({
    url: '/general/generalBizDict/updateGeneralBizDict',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteGeneralBizDict = (params) => {
  params.head.transCode = 'deleteGeneralBizDict';
  return request({
    url: '/general/generalBizDict/deleteGeneralBizDict',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteGeneralBizDictList = (params) => {
  params.head.transCode = 'deleteGeneralBizDictList';
  return request({
    url: '/general/generalBizDict/deleteGeneralBizDictList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportGeneralBizDictExcel = (params) => {
  downloadExcel({
    url: '/general/generalBizDict/exportGeneralBizDictExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
